home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-1097 / AMOSLIST / text0083.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  2.5 KB  |  74 lines

  1. On 07-Oct-97, Cori Skagen scribbled:
  2. >Hi everyone,
  3.  
  4. Hello :)
  5.  
  6. >I was wondering if there's a way of finding the particular device
  7. >that a volume belongs to:
  8. >eg. Given "Workbench:" I want to find its particular device such as
  9. > "dh0:"
  10. >Its easy enough to find the volume name given the device by using
  11. >the AMCAF extension, but I need to do it the other way around.
  12. >Any help would be appreciated
  13.  
  14. Well, this does the opposite, but I'm sure you could fiddle about with
  15. it and get the results and best of all, no extensions as suggested...
  16.  
  17. Cut  and save as AMOSFILE.asc and load into Amos using the Merge Ascii
  18. option from the Project menu...
  19.  
  20.  
  21. '
  22. ' *****************************
  23. '  Get Volume Name From Device 
  24. '    Without Any Extensions
  25. '    bY Andy Gibson - AGAS.
  26. '     Written during 1996
  27. ' *****************************
  28. '
  29. '
  30. ' If you have a disk in any drive and you want to kno what its name
  31. ' is (ie. Volume name) simply use the following code...
  32. '
  33. '  You can use any device name such as DF0: DF1: HD0: DH0: etc.
  34. '
  35. ' Hope this helps someone....
  36. '
  37. ' It's good for all sorts of things. I think there are various 
  38. ' extensions that can do this also, but I'm sure there is someone
  39. ' out there who asked for something like this a few days ago ;^) 
  40. '
  41.    PATH$="df1:" : Rem add a filename too if you want :)
  42.    XAMOUNT=Instr(PATH$,":")
  43.    SDISK$=Left$(PATH$,XAMOUNT)
  44.    FILE$=PATH$-SDISK$
  45.    Dir$=SDISK$ : OLD_DIR$=Dir$
  46.    FINAL$=OLD_DIR$+FILE$
  47.    Print FINAL$
  48. '
  49. ' The printed result will be the name of the disk in DF1: in this
  50. ' example. It may be crude, but has never let me down. 
  51. '
  52. ' One example to use this for would be when an app lets the user 
  53. ' enter some data to save. Most peeps would type.... 
  54. ' DF0:File, so now you can save to the correct disk for later
  55. ' accessing of their file from correct location. No more silly 
  56. ' requestors asking for you to PLEASE INSERT DF0: IN ANY DRIVE!!!
  57. '
  58. ' Andy Gibson - AGAS Productions.
  59. '
  60. '
  61.  
  62. -- 
  63.  ___________________________________ ________________________________
  64. |  _     _                          |                                |
  65. | (-)/\//_)\/    AGAS Productions   |    #cONTACT mE fOR mORE iNFO#    |
  66. |   Gibson_/           9T7          |    #oN aREA51 rELEASES aLSO!#    |
  67. |                                   |                                |
  68. |    andy@agasinc.demon.co.uk       |        cOMING sOON'ish         |
  69. |                                   |        *Roswell Gfx Adv*         |
  70. |     -=<(aka SKiDZ/A51)>=-         |              9T7               |
  71. |___________________________________|________________________________|
  72.  
  73.  
  74.